﻿CREATE PROCEDURE dbo.procCreateException
	@ID char(49),
	@System nVarChar(20),
	@Message nVarChar(250),
	@Source nVarChar(250),
	@StackTrace nVarChar(MAX),
	@TargetSite nVarChar(250),
	@ExceptionDateTime dateTime,
	@SeverityID smallInt,
	@NotificationSent bit,
	@ClassName nVarChar(500),
	@MethodName nVarChar(500)
AS

/****************************************************************************************************
 **        Name: procCreateException
 ** Description: Creates a new Exception record.
 ****************************************************************************************************
 ** Revisions
 **  Date        Author               Work Item  Description
 **  ----------  -------------------  ---------  ----------------------------------------------------
 **  11/30/2008  Chad Green             11774    Initial Development
 ****************************************************************************************************/

BEGIN TRY
	INSERT INTO Exception (ID,
	                       System,
	                       Message,
	                       Source,
	                       StackTrace,
	                       TargetSite,
	                       ExceptionDateTime,
	                       SeverityID,
	                       NotificationSent,
	                       ClassName,
	                       MethodName)
	               VALUES (@ID,
	                       @System,
	                       @Message,
	                       @Source,
	                       @StackTrace,
	                       @TargetSite,
	                       @ExceptionDateTime,
	                       @SeverityID,
	                       @NotificationSent,
	                       @ClassName,
	                       @MethodName)

END TRY
BEGIN CATCH
	EXEC procCreateSQLErrorLog
END CATCH
GO

EXEC sp_addextendedproperty @name='MS_Descritpion', @value ='Creates a new Exception record.', @level0type = 'SCHEMA', @level0name = 'dbo', @level1type = 'PROCEDURE', @level1name = 'procCreateException', @level2type = NULL, @level2name = NULL
GO